package com.jilian.powerstation.utils;

import java.util.List;

public class StringUtils {
    private static final String SEPARATOR = ",";
    public static  String  Java7ListToString(List<String> letters) {

        StringBuilder strBuilder = new StringBuilder();
        for(String letter : letters){
            strBuilder.append(letter);
            strBuilder.append(SEPARATOR);
        }
        String strLetter = strBuilder.toString();
        System.out.println(strLetter);
        //OUTPUT: A,B,C,D,
        //Remove last comma
        strLetter = strLetter.substring(0, strLetter.length() - SEPARATOR.length());
        return strLetter;
    }

}
